#ifndef WRITER_H
#define WRITER_H

#include <QRunnable>
#include <QObject>
#include "shelf.h"

class Writer : public QObject, public QRunnable
{
    Q_OBJECT
public:
    explicit Writer(QString name, int writeTime, int editTime, Shelf *shelf, QObject *parent = 0);

    void run();
    
signals:
    void actived();
    void waited();
    void newBookWrited();

    void activeChange(bool active);
    
private slots:
    void activeChanged(bool active);

private:
    QString name;

    int writeTime;
    int editTime;
    Shelf *shelf;

    bool isActive;
    
};

#endif // WRITER_H
